

function rightsortactive()
{
    $('.btnrx').click(function() {
        var rel = $(this).attr('rel');
        $('.btnrx').removeClass('active');
        $(this).addClass('active');
        $('.listsort').hide();
        $('#'+rel).show();
    })
}

$("document").ready(function() {
    
    rightsortactive();
    
	var jplist = $("#ilist").jplist({
	//main options
    	items_box: ".listsort", //items container
    	item_path: ".list-item", //path to the item
    	css_prefix: "jplist",
    	cookies: true,
    	redraw_callback: "",
    	
    	//sort
    	sort: {title: "h2.title",
               numpage: "span.numpage",
    		   description: "p.desc",
               view: 'span.view',
               download: 'span.download',
    		   date: "p.date"},
    	sort_name: "title",
    	sort_order: "asc", //"desc",
    	sort_type: "text",
    	
    	//filter
    	filter_path: ".filter",
    	filter: {title: "h2.title",
    			 description: "p.desc"},
    	
    	//paging
    	pagingbox: ".buttons",
    	pageinfo: ".info",
    	items_on_page: 5,
    	paging_length: 7,  //pager length
    	show_one_page: false,
    	
    	//drop down
    	sort_dd_path: ".sort-drop-down",
    	paging_dd_path: ".page-by"					
    });
});